﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:pv="clr-namespace:System.Windows.Pivot;assembly=System.Windows.Pivot"
    xmlns:local="clr-namespace:PivotPhysics_Viewer"
    xmlns:SampleData="clr-namespace:Expression.Blend.SampleData.KnownCollections" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" x:Class="PivotPhysics_Viewer.MainPage"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400" Loaded="UserControl_Loaded">

	<UserControl.Resources>
		<SampleData:KnownCollections x:Key="KnownCollections" d:IsDataSource="True"/>
		<DataTemplate x:Key="KnownItemsItemTemplate">
			<StackPanel>
				<toolkit:LayoutTransformer>
					<toolkit:LayoutTransformer.LayoutTransform>
						 <RotateTransform Angle="270" />
					</toolkit:LayoutTransformer.LayoutTransform>
					<TextBlock TextWrapping="Wrap" Text="{Binding Name}" VerticalAlignment="Top" Margin="2,0"/>
				</toolkit:LayoutTransformer>
			</StackPanel>
		</DataTemplate>
	</UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="White" d:DataContext="{Binding Source={StaticResource KnownCollections}}">
    	<Grid.ColumnDefinitions>
    		<ColumnDefinition Width="26"/>
    		<ColumnDefinition MinWidth="650"/>
    	</Grid.ColumnDefinitions>
    	<StackPanel Margin="0,1,0,0">
    		<Button x:Name="MoveForwardButton" Content="FW" ToolTipService.ToolTip="Forward To Next View"/>
    		<Button x:Name="MoveBackButton" Content="BK" ToolTipService.ToolTip="Back To Last View"/>
    		<Button x:Name="FullScreenButton" Content="FS" ToolTipService.ToolTip="Toggle Fullscreen Mode">
    			<i:Interaction.Triggers>
    				<i:EventTrigger EventName="Click">
    					<local:FullScreenAction/>
    				</i:EventTrigger>
    			</i:Interaction.Triggers>
    		</Button>
    		<ListBox x:Name="CollectionChooser" ItemTemplate="{StaticResource KnownItemsItemTemplate}" ItemsSource="{Binding KnownPlotCollections}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled" Margin="0" SelectionChanged="CollectionChooser_SelectionChanged" />
    	</StackPanel>
    	<pv:PivotViewer x:Name="MainViewer" Grid.Column="1" Margin="0" d:LayoutOverrides="Height, HorizontalMargin" HorizontalAlignment="Left" LinkClicked="MainViewer_LinkClicked" >
    		<i:Interaction.Behaviors>
    		</i:Interaction.Behaviors>
    	</pv:PivotViewer>
    </Grid>
</UserControl>
